mssql

推荐列表 站点导航

当前位置:首页 > 数据库 > mssql >

通过T_sql语句向其中一次填入一条数据或一次填入多条数据的方式

来源:网络整理  作者:网络  发布时间:2020-12-10 11:43
使用T_sql语句向其中一次填入一条数据或一次填入多条数据的方式填入数据,需要的朋友可以参考下...

3) Select 列 into 新表名 from 旧表
sName nvarchar(50) not null,
tTAge int,
select 1,90,97 union
select 6,0,100 union
select 2,90,70 union
name='TestSchool',
studentId int identity(1,1) primary key,
insert into TblScore
sAge int not null,
sEmail varchar(50),
filegrowth=10,


create table TblScore
studentId int not null, --学生id,外键
truncate table TblStudent


select * from TblTeacher
select '杨巧巧',0,21,10000,'1991-6-6'
filename='F:\SQL Server\TestSchool_log.ldf'
insert into TblTeacher
select 4,'华佗',50,12345678901234565,'[email protected]',1,'1957-1-16' union
size=10mb,
select '刘祎',0,22,10000,'1991-11-06' union

(
select '商炳奇',1,22,10000,'1991-10-30' union
(
)
创建老师表 TblTeacher q tTId 、 tTName 、 tTGender 、 tTAge 、 tTSalary 、 tTBirthday
select 4,'曹操',22,123456789012345673,'[email protected]',1,'1985-12-6' union
select '段琳琳',0,22,10000,'1991-6-6' union
tEnglish float,
创建一个学生表 TblStudent
create database TestSchool
select '王静静',0,22,10000,'1991-6-6' union

(
select 3,59,100 union
select 1,'刘备',20,123456789012345678,'[email protected]',1,'1987-5-6' union


)
maxsize=100mb
tScoreId int identity(1,1) primary key,
tTGender bit default(1),
select 4,'甄姬',18,12345678901234565,'[email protected]',0,'1989-8-8'
select '耿宇丹',0,21,10000,'1992-12-30' union
创建学生成绩表 TblScore q tScoreId (成绩 id, 主键 , 自动编号)、 tSId (学生编号)、 tEnglish (英语成绩)、 tMath (数学成绩)
(
tTSalary money,
tTName nvarchar(50) not null,
tScoreId int not null,
)
sGender bit default(1),
(
sNo numeric(18,0),--身份证号,十八位数字,小数位0
1)Insert into 表(列) select 列 1 ,列 2 union
select 5,60,96 union
tTBirthday datetime
select 1,'关羽',19,123456789012345671,'[email protected]',1,'1988-8-6' union
create table TblStudent
select 1,'张飞',18,123456789012345672,'[email protected]',1,'1989-5-19' union
log on
tMath float

sBirthday datetime
select * from TblStudent
2)Insert into 表(列) select 列 1 ,列 2 from 表
select 4,100,80 union

复制代码 代码如下:

select '张少丹',0,22,10000,'1991-6-6' union
filename='F:\SQL Server\TestSchool.mdf',
)

并使用T_sql语句向其中一次填入一条数据或一次填入多条数据的方式填入数据。
select 4,'夏侯惇',22,123456789012345674,'[email protected]',1,'1985-3-6' union

on primary

使用T_SQL创建数据库 TestSchool
select 7,80,60
select * from TblScore
name='TestSchool_log',
truncate table TblScore
insert into TblStudent

create table TblTeacher
)
tTId int identity(1,1) primary key,

相关热词: SQL语句

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/sql/mssql/2155.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

通过T_sql语句向其中一次填入一条数据或一次填入多条数据的方式

2020-12-10 编辑:网络


3) Select 列 into 新表名 from 旧表
sName nvarchar(50) not null,
tTAge int,
select 1,90,97 union
select 6,0,100 union
select 2,90,70 union
name='TestSchool',
studentId int identity(1,1) primary key,
insert into TblScore
sAge int not null,
sEmail varchar(50),
filegrowth=10,


create table TblScore
studentId int not null, --学生id,外键
truncate table TblStudent


select * from TblTeacher
select '杨巧巧',0,21,10000,'1991-6-6'
filename='F:\SQL Server\TestSchool_log.ldf'
insert into TblTeacher
select 4,'华佗',50,12345678901234565,'[email protected]',1,'1957-1-16' union
size=10mb,
select '刘祎',0,22,10000,'1991-11-06' union

(
select '商炳奇',1,22,10000,'1991-10-30' union
(
)
创建老师表 TblTeacher q tTId 、 tTName 、 tTGender 、 tTAge 、 tTSalary 、 tTBirthday
select 4,'曹操',22,123456789012345673,'[email protected]',1,'1985-12-6' union
select '段琳琳',0,22,10000,'1991-6-6' union
tEnglish float,
创建一个学生表 TblStudent
create database TestSchool
select '王静静',0,22,10000,'1991-6-6' union

(
select 3,59,100 union
select 1,'刘备',20,123456789012345678,'[email protected]',1,'1987-5-6' union


)
maxsize=100mb
tScoreId int identity(1,1) primary key,
tTGender bit default(1),
select 4,'甄姬',18,12345678901234565,'[email protected]',0,'1989-8-8'
select '耿宇丹',0,21,10000,'1992-12-30' union
创建学生成绩表 TblScore q tScoreId (成绩 id, 主键 , 自动编号)、 tSId (学生编号)、 tEnglish (英语成绩)、 tMath (数学成绩)
(
tTSalary money,
tTName nvarchar(50) not null,
tScoreId int not null,
)
sGender bit default(1),
(
sNo numeric(18,0),--身份证号,十八位数字,小数位0
1)Insert into 表(列) select 列 1 ,列 2 union
select 5,60,96 union
tTBirthday datetime
select 1,'关羽',19,123456789012345671,'[email protected]',1,'1988-8-6' union
create table TblStudent
select 1,'张飞',18,123456789012345672,'[email protected]',1,'1989-5-19' union
log on
tMath float

sBirthday datetime
select * from TblStudent
2)Insert into 表(列) select 列 1 ,列 2 from 表
select 4,100,80 union

复制代码 代码如下:

select '张少丹',0,22,10000,'1991-6-6' union
filename='F:\SQL Server\TestSchool.mdf',
)

并使用T_sql语句向其中一次填入一条数据或一次填入多条数据的方式填入数据。
select 4,'夏侯惇',22,123456789012345674,'[email protected]',1,'1985-3-6' union

on primary

使用T_SQL创建数据库 TestSchool
select 7,80,60
select * from TblScore
name='TestSchool_log',
truncate table TblScore
insert into TblStudent

create table TblTeacher
)
tTId int identity(1,1) primary key,

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/sql/mssql/2155.shtml

相关文章

风云图片

推荐阅读

返回mssql频道首页